<div class="block">

    <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>

        <h2>Danh sách Bộ ảnh của cô gái</h2>
        <ul>
            <li><a href="cms/girl/add">Thêm mới</a></li>
        </ul>

    </div>		<!-- .block_head ends -->



    <div class="block_content">

        <form action="" method="post">

            <table cellpadding="0" cellspacing="0" width="100%" class="sortable">

                <thead>
                <tr>
                    <th>Tên</th>
                    <th>Ngày sinh</th>
                    <th>Sở thích</th>
                    <th>Năng khiếu</th>
					<th>Ảnh 1</th>
					<th>Ảnh 2</th>
					<th>Ảnh 3</th>
					<th>Ảnh 4</th>
					<th>Ảnh 5</th>
					<th>Trạng thái</th>
                    <th>Ghi chú</th>
					<th>Thời gian</th>
                    <th colspan="2">Thao tác</th>
                </tr>
                </thead>

                <tbody>
		<?php if($rows):foreach($rows as $row):?>
			<tr>
		<?php foreach($fields as $field_name => $field_display): ?>

		<?php if($field_name == "image1"||$field_name == "image2"||$field_name == "image3"||$field_name == "image4"||$field_name == "image5"){
				if($row->$field_name != ""){
					echo '<td><img src="uploads/girl/'.$row->$field_name.'" width="60" height="60" border="0" /></td>';
				} else {
					echo '<td></td>';
				}
			} elseif($field_name == "status"){
				if($row->$field_name == 0){
					echo '<td>Ẩn</td>';
				} else {
					echo '<td>Hiện</td>';
				}
			}
			elseif($field_name == "gid"){
					echo '';
			}
			elseif($field_name == "birthday"){
				echo '<td>'.date('Y-m-d H:i:s', $row->$field_name).'</td>';
			}
			elseif($field_name == "time_update"){
				echo '<td>'.date('Y-m-d H:i:s', $row->$field_name).'</td>';
			}	
			 else {
				echo '<td>'.$row->$field_name.'</td>';
		} ?>

<?php endforeach; ?>
<td class="edit"><a href="cms/girl/edit/<?php echo $row->gid; ?>">Sửa</a></td>
<td class="edit"><a href="cms/girl/delete/<?php echo $row->gid; ?>">Xóa</a></td>
	</tr>
<?php endforeach; else:?>
	<tr><td colspan="5">Hiện chưa có dữ liệu</td></tr>
<?php endif;?>
                </tbody>

            </table>

            <div class="pagination right">
<?php if(strlen($pagination)): ?>
Page : <?php echo $pagination; ?>
<?php endif; ?>
            </div>		<!-- .pagination ends -->

        </form>

    </div>		<!-- .block_content ends -->

    <div class="bendl"></div>
    <div class="bendr"></div>
</div>		<!-- .block ends -->